import React, {useEffect, useRef} from "react";
import style from './LocalHome.module.less';
import LeftBox from "./leftBox/LeftBox";
import {HashRouter, Route, Switch} from "react-router-dom";

// 确保这些导入都是有效的 React 组件
import Camera from './cameraTest/camera';
import DeviceManage from './deviceManage/deviceManage';
import WebSocketTest from './websocketTest/websocketTest';
import WebRTCTest from './webrtcTest/webrtc';
import {Desktop} from "./desktopTest/desktop";


export default function LocalHome() {
    return (
        <div className={style.localhomeContainer}>
            <LeftBox />

            <div className={style.rightBox}>
                <Switch>
                    <Route path={'/localHome/DesktopTest'}>
                        <Desktop />
                    </Route>
                    <Route path={'/localHome/CameraTest'} >
                        <Camera />
                    </Route>
                    <Route path={'/localHome/DeviceManage'}>
                        <DeviceManage />
                    </Route>
                    <Route path={'/localHome/WebSocketTest'}>
                        <WebSocketTest/>
                    </Route>
                    <Route path={'/localHome/WebRTCTest'} >
                        <WebRTCTest />
                    </Route>
                </Switch>
            </div>


        </div>
    );
}